package com.example.lenovo.demo.presenter.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.example.lenovo.demo.view.CityFirstHotFragment;
import com.example.lenovo.demo.view.StrateChildFragment;

import java.util.List;

/**
 * Created by Lenovo on 2017/1/15.
 */

public class CityFirstHotVpAdater extends FragmentPagerAdapter {
    private List<CityFirstHotFragment> data;
    private String[] titles;
    public CityFirstHotVpAdater(FragmentManager fm,List<CityFirstHotFragment> data,String[] titles) {
        super(fm);
        this.data=data;
        this.titles=titles;
    }

    @Override
    public Fragment getItem(int position) {
        return data.get(position);
    }

    @Override
    public int getCount() {
        return data.size();
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }

}
